package me.lc.hammerheads.util;

import me.lc.hammerheads.core.GameSystem;
import android.content.SharedPreferences.Editor;

public class ShareSettingUtil {

	/**
	 * 获取String对象
	 * 
	 * @param key
	 * @return
	 */
	public static String getStringSetting(String key) {
		return GameSystem.SharedSettings.getString(key, "null");
	}

	/**
	 * 保存文本
	 * 
	 * @param key
	 * @param content
	 */
	public static void storeStringSetting(String key, String content) {
		Editor editor = GameSystem.SharedSettings.edit();
		editor.putString(key, content);
		editor.commit();
	}

	public static void storeIntSetting(String key, int content) {
		Editor editor = GameSystem.SharedSettings.edit();
		editor.putInt(key, content);
		editor.commit();
	}

	public static int getIntSetting(String key, int defaultValue) {
		return GameSystem.SharedSettings.getInt(key, defaultValue);
	}
}
